import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import axios from 'axios'
import config from "vue/src/core/config";
Vue.prototype.$http=axios
Vue.config.productionTip = false
// 设置axios请求的拦截器
axios.interceptors.request.use(config=>{
  //从localStorage获取令牌信息
  var token =localStorage.getItem("token");
  //判断是否获取token 有值返回true
  if(token){
    config.headers.token=token;
  }
  return config;
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
